home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_075 / dum2 / src / duwindow.def < prev    next >
Text File  |  1992-05-06  |  3KB  |  107 lines

  1. DEFINITION MODULE DuWindow;
  2.  
  3. (*
  4.         PART OF DirUtil for Modula 2
  5.  
  6.         This creates, opens and maintains the DirUtil window.
  7.         It contains a couple of other importable routines for
  8.         user alteration.
  9.  
  10.         Written: 3/21/87 by Greg Browne
  11.  
  12.         Compiles on TDI's Modula-2 Compiler version 2.20a
  13.  
  14.  NOTES: I kept being bugged with RefreshWindow not being exported from
  15.         Intuition as a flag. Then I found that it is either misspelled
  16.         in the .def module (as  ResfreshWindow) or that it is supposed
  17.         to mean ResetFreshWindow. Don't know whats up but it works now.
  18.  
  19. *)
  20.  
  21. FROM Intuition          IMPORT  ActivationFlags,ActivationFlagSet,Gadget,
  22.                                 PropFlags,PropFlagSet,IntuitionText,
  23.                                 RequesterPtr,WindowPtr,StringInfo;
  24. FROM GraphicsLibrary    IMPORT  DrawingModes,DrawingModeSet;
  25.  
  26. (*--------------------------------------------------------------------*)
  27.  
  28. (* ALMOST ALL CONSTANTS AND MOST VARIABLES/TYPES DEFINED IN .DEF FILE
  29.    FOR IMPORTATION
  30. *)
  31.  
  32. CONST
  33.   StringBufSize = 255;
  34.   RegFlags      = ActivationFlagSet{RelVerify,GadgetImmediate};
  35.   StringFlags   = ActivationFlagSet{StringCenter} + RegFlags;
  36.   JamTwo        = DrawingModeSet{Jam2};
  37.   SliderFlags   = PropFlagSet{FreeVert,AutoKnob};
  38.  
  39. TYPE
  40.   WBColors      = (Blue,White,Black,Green);     (* My workbench colors *)
  41.  
  42. (*
  43.    Gadgets are addressed as a set. First are the devices, then the message
  44.    string gadgets, then the command gadgets, and finally the slider.  Note
  45.    that this is larger than a BITSET already, so the 'GadgetID' is passed as
  46.    a set name and converted as CARDINAL(ORD(whatever)). Expansion of the set
  47.    should be easy, with only screen positioning being the hard part.
  48. *)
  49.  
  50.   GadgetNames   = (df0,df1,df2,dh0,dh1,ram,vd0,
  51.                    run,source,dest,msg,
  52.                    filewindow,
  53.                    arc,bytes,clear,copy,copydel,deldir,edit,execfr,execrf,
  54.                    hprint,htype,info,makedir,move,parent,print,rename,
  55.                    root,runfr,runrf,select,show,type,zapfile,
  56.                    dtor,dtos,rtod,rtos,stod,stor,swapsd,swaprd,swaprs,
  57.                    slider);
  58.  
  59.  
  60. (* EXTERNAL AVAILABLE VARIABLES *)
  61.  
  62. VAR
  63.  
  64.   IOStringInfo  : ARRAY[run..filewindow] OF StringInfo;
  65.   NullReqPtr    : RequesterPtr;   (* initialized to be NULL always *)
  66.   DuWindowPtr   : WindowPtr;
  67.   IOString      : ARRAY[run..filewindow] OF ARRAY[0..StringBufSize-1] OF CHAR;
  68.   GadTxt        : ARRAY GadgetNames OF IntuitionText;
  69.   DuGads        : ARRAY GadgetNames OF Gadget;
  70.  
  71.  
  72.  
  73. (* ---------------------------*)
  74. (*     EXTERNAL PROCEDURES    *)
  75. (* ---------------------------*)
  76. PROCEDURE SlidePot():CARDINAL;
  77. (*
  78.   Function returns the current value of the VertPot of the slider
  79. *)
  80.  
  81.  
  82. PROCEDURE ResetSlider(bod:CARDINAL);
  83. (*
  84.    Resets slide gadget size to the size passed in
  85. *)
  86.  
  87.  
  88.  
  89. PROCEDURE CloseDuWindow;
  90. (*
  91.   Closes the window and intuition and graphics bases if they are open
  92. *)
  93.  
  94.  
  95. PROCEDURE OpenDuWindow(VAR name:ARRAY OF CHAR):BOOLEAN;
  96.  
  97. (*
  98.         The external primary procedure - sets up and opens the window
  99.         or returns FALSE.  The window may be accessed through
  100.         the import of DuWindowPtr
  101.  
  102. *)
  103.  
  104.  
  105. END DuWindow.
  106.  
  107.